package com.example.service.impl;

import com.example.entity.HnyyFeedback;
import com.example.mapper.FeedbackMapper;
import com.example.service.FeedbackService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class FeedbackServiceImpl implements FeedbackService {
    @Autowired
    private FeedbackMapper feedbackMapper;
    @Override
    public Integer addFeedback(HnyyFeedback feedback) {

        return feedbackMapper.addFeedback( feedback);
    }

    @Override
    public int getNum() {
        return feedbackMapper.getNum();
    }

    @Override
    public PageInfo<HnyyFeedback> selectPickingCartonDetails(Integer pageNum, Integer pageSize, String name,String type) {
        // 开启分页查询
        PageHelper.startPage(pageNum,pageSize);
        List<HnyyFeedback> basicInfos = feedbackMapper.selectPickingCartonDetails(name,type);
        return PageInfo.of(basicInfos);
    }

    @Override
    public int update(HnyyFeedback hnyyFeedBack) {
        return feedbackMapper.update(hnyyFeedBack);
    }
}
